<?php
class Controller{
	public function action(){
		trigger_error("Unimpletment action method.");
	}
	
	
	public function display($view){
		echo json_encode($view);
	}
	
	public function displayByCode($code,$h_view = null){
		if($h_view != null){
			$this->display($h_view->getViewByCode($code));
		}else{
			if(isset($this->view)){
				$this->display($this->view->getViewByCode($code));
			}else{
				dumpError('当前的Controller子类没有定义view成员，无法使用displayByCode便捷方法');
			}
			
		}
	}
	
}